package com.example.springboot_mongo.config;

import com.alibaba.fastjson.JSONObject;
import org.springframework.boot.CommandLineRunner;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * 项目启动加载 implements CommandLineRunner   bean
 */
@Component
public class InitProcess implements CommandLineRunner {
    @Resource
    private RestTemplate restTemplate;
    public static Map<String,String> map=new HashMap<>();
    @Override
    public void run(String... args) throws Exception {
        System.out.println("初始化加载....");
        map.put("a","a");
        map.put("b","b");
        map.put("c","c");
        map.forEach((x,y) ->{
            System.out.println(x+":"+y);
        });
    }
}
